package cn.com.oceansoft.nos.common.util;

import java.util.Map;

public class MapUtils {
    @SuppressWarnings("all")
    public static void putIfNull(Map map, Object key, Object defaultValue) {
        if (key == null)
            throw new IllegalArgumentException("key must be not null");
        if (map == null)
            throw new IllegalArgumentException("map must be not null");
        if (map.get(key) == null) {
            map.put(key, defaultValue);
        }
    }
}
